<template>
  <div style="height: 100%">
    <!-- <callRoom ref="callRoom"/> -->
    <div class="dialogBox">
      <div class="dialogContainer">
        <div class="dialogTitle">
          请选择通讯方式
          <i
            @click="logout"
            class="el-icon-close"
            style="position: absolute; right: 1rem; cursor: pointer"
          ></i>
        </div>
        <hr />
        <div class="dialogText">
          工作时间：周一至周五9:00-18:00<br />
          (不含法定节假日)
        </div>
        <div class="dialogButtonBox">
          <el-button
            type="success"
            round
            @click="changeTypeClick(1)"
            style="
              width: 4rem;
              font-size: 0.8rem;
              height: 2.2rem;
              text-align: center;
              padding: 0.2rem;
            "
            >语音</el-button
          >
          <el-button
            style="
              margin-left: 2.8rem;
              width: 4rem;
              font-size: 0.8rem;
              height: 2.2rem;
              text-align: center;
              padding: 0.2rem;
            "
            type="primary"
            round
            @click="changeTypeClick(2)"
            >视频</el-button
          >
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { mapState, mapMutations } from "vuex";
//import callRoom from "@/components/call-room/index.vue";
export default {
  name: "callPage",
  data() {
    return {
      changeType: 0, //选择了哪种通信方式：0：未选择展示弹窗  1：选择  2：视频
    };
  },
  components: {
    //callRoom,
  },
  computed: {
    ...mapState({
      currentUserId: (state) => state.currentUserId, //当前的用户id
      userInfoDetails: (state) => state.userInfoDetails,
      loginUserInfo: (state) => state.loginUserInfo,
    }),
  },
  watch: {},
  mounted() {},
  methods: {
    ...mapMutations([
      "setChangeType", //设置通讯类型
    ]),
    //选择通讯方式
    changeTypeClick(type) {
      this.setChangeType(type);
      this.$router.push("call-page");
      console.log("选择的通讯方式", type);
    },
    logout() {
      //退出到首页
      this.$router.push("/");
      //this.leaveRoom();
    },
  },
};
</script>
<style scoped>
.dialogBox {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  flex-wrap: wrap;
  background-color: rgb(76, 76, 76);
}
.dialogContainer {
  width: 22rem;
  padding-bottom: 1rem;
  background-color: white;
  border-radius: 0.7rem;
  position: relative;
}
.dialogTitle {
  padding: 0.4rem 1rem 0rem;
}
.dialogText {
  margin-top: 2rem;
  color: black;
  line-height: 1.8rem;
}
.dialogButtonBox {
  margin-top: 1rem;
}
</style>